package is.origo.portlet.events;

import org.w3c.dom.DOMException;
import org.w3c.dom.Element;

import javax.portlet.*;
import javax.servlet.http.Cookie;
import javax.xml.namespace.QName;
import java.io.IOException;
import java.io.Serializable;
import java.util.Map;


/**
 * @author vidar.svansson
 */
public class EventActionResponse
        implements ActionResponse {

    private ActionResponse response;

    public EventActionResponse(ActionResponse response) {
        this.response = response;
    }

    public void setEvent(QName qName, Serializable serializable) {
        try {
            response.setEvent(qName, serializable);
        }
        catch (AbstractMethodError e) {
            Events.events.get().put(qName, serializable);
        }
    }

    public void setEvent(String s, Serializable serializable) {
        response.setEvent(s, serializable);
    }

    public void sendRedirect(String s)
            throws IOException {
        response.sendRedirect(s);
    }

    public void sendRedirect(String s, String s1)
            throws IOException {
        response.sendRedirect(s, s1);
    }

    public void setWindowState(WindowState windowState)
            throws WindowStateException {
        response.setWindowState(windowState);
    }

    public void setPortletMode(PortletMode portletMode)
            throws PortletModeException {
        response.setPortletMode(portletMode);
    }

    public void setRenderParameters(Map stringMap) {
        response.setRenderParameters(stringMap);
    }

    public void setRenderParameter(String s, String s1) {
        response.setRenderParameter(s, s1);
    }

    public void setRenderParameter(String s, String strings[]) {
        response.setRenderParameter(s, strings);
    }

    public Map getRenderParameterMap() {
        return response.getRenderParameterMap();
    }

    public PortletMode getPortletMode() {
        return response.getPortletMode();
    }

    public WindowState getWindowState() {
        return response.getWindowState();
    }

    public void removePublicRenderParameter(String s) {
        response.removePublicRenderParameter(s);
    }

    public void addProperty(String s, String s1) {
        response.addProperty(s, s1);
    }

    public void setProperty(String s, String s1) {
        response.setProperty(s, s1);
    }

    public String encodeURL(String s) {
        return response.encodeURL(s);
    }

    public String getNamespace() {
        return response.getNamespace();
    }

    public void addProperty(Cookie cookie) {
        response.addProperty(cookie);
    }

    public void addProperty(String s, Element element) {
        response.addProperty(s, element);
    }

    public Element createElement(String s)
            throws DOMException {
        return response.createElement(s);
    }


}